package com.ssy.lingxi.logistics.controller.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.logistics.api.dto.request.LogisticsCompanyAddRequest;
import com.ssy.lingxi.logistics.service.ILogisticsCompanyFeignService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 内部feign接口 - 初始化基础物流公司
 * @author wyx
 * @version 2.0.0
 * @date 2021-12-14
 */
@RestController
@RequestMapping("/logistics/company/feign")
public class LogisticsCompanyFeignController {
    @Resource
    private ILogisticsCompanyFeignService logisticsCompanyFeignService;


    /**
     * 添加基础物流公司
     * @param request 接口参数
     * @return 返回结果
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public Wrapper<Void> addCompany(@RequestBody @Validated LogisticsCompanyAddRequest request) {
        logisticsCompanyFeignService.addCompany(request);
        return Wrapper.success();
    }
}
